//This program demonstrates the use of default function arguments.
#include <iostream>
using namespace std;
//Function prototype with default arguments
void displayStars(int starsPerRow = 10,int numRows = 1);

//默认参数
//JAVA:
//int dispay(int... a)
//{
//
//}
int main()
{
    displayStars(); // starsPerRow & numRows use defaults (10 & 1) cout << endl;
    displayStars (5); // starsPerRow 5. numRows uses default value 1 cout << endl;
    displayStars (7, 3); // starsPerRow 7. numRows 3. No defaults used. return 0;
//    displayStars ( , 3); // 非法函数调用
}
void displayStars(int starsPerRow , int numRows)
{
    cout << starsPerRow << "----------" << numRows  <<endl;
    for (int row = 1; row <= numRows; row++)
    {
        for (int star = 1; star <= starsPerRow; star++)
            cout << '*';
        cout << endl;
    }
}